package com.wxsh;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.io.FileUtils;

/**
 * 提取陌生的单词
 * @author wxsh
 */
public class ExtractUnknownWords {
	
	public static void main(String[] args) throws Exception {
		
		List<String> allWords = FileUtils.readLines(new File("D:\\test\\EnglishWords.txt"), "utf-8");
		List<String> skipKownWords = FileUtils.readLines(new File("C:\\Users\\Administrator\\git\\EnglishWords\\熟单词表[手工录入].txt"), "utf-8");
		List<String> kownWords = FileUtils.readLines(new File("C:\\Users\\Administrator\\git\\EnglishWords\\熟单词表.txt"), "utf-8");
		List<String> unkownWords = FileUtils.readLines(new File("C:\\Users\\Administrator\\git\\EnglishWords\\生单词表.txt"), "utf-8");
		List<String> destLines = new ArrayList<String>();
		
		for (String word : allWords) {
		    if(skipKownWords.contains(word)){
		        continue;
		    }
		    if(unkownWords.contains(word)){
		        destLines.add(word);
		    }else if(kownWords.contains(word)){
		        continue;
		    }else{
		        destLines.add(word);
		    }
		}
		
		FileUtils.writeLines(new File("D:\\test\\UnkownWords.txt"), "utf-8", destLines, false);
	}
	
}
